function nanoid(size = 21) {
  let id = '';
  const urlAlphabet = 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';
  const mask = urlAlphabet.length - 1;
  const step = Math.log(urlAlphabet.length) / Math.log(256);
  const random = () => Math.random() * 256;

  while (size--) {
    id += urlAlphabet[Math.floor(random() * step) & mask];
  }
  return id;
}

export default nanoid;